9c6228d948b7f8c1cead821030cabe67390f8ec0,source/net/yacy/crawler/HostBalancer.java,HostBalancer,pop,#boolean#CrawlSwitchboard#RobotsTxt#,230

Before Change


                    int size = hq == null ? 0 : hq.size();
                    if (size == 0) {
                        hq.close();
                        this.queues.remove(nextHH);
                    }
                    if (request != null) return request;
                }

After Change


                Iterator<String> nhhi = this.roundRobinHostHashes.iterator();
                nosleep: while (nhhi.hasNext()) {
                    rhh = nhhi.next();
                    rhq = this.queues.get(rhh);
                    if (rhq == null) {
                        nhhi.remove();
                        continue nosleep;
                    }
                    int delta = Latency.waitingRemainingGuessed(rhq.getHost(), DigestURL.hosthash(rhq.getHost(), rhq.getPort()), robots, ClientIdentification.yacyInternetCrawlerAgent);
                    if (delta <= 10 || this.roundRobinHostHashes.size() == 1) {
                        nhhi.remove();
                        break nosleep;
                    }
                }
                
                if (rhq == null) {
                    // second strategy: take from the largest stack and clean round robin cache
                    int largest = Integer.MIN_VALUE;
                    for (String h: this.roundRobinHostHashes) {